<%--
  Created by IntelliJ IDEA.
  User: ASUS
  Date: 2021/11/17
  Time: 22:10
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    Cookie[] cookies = request.getCookies();
    String name= (String) session.getAttribute("name");
        for (Cookie cookie1 :cookies) {
            if(cookie1.getName().equals("logined")){
                cookie1.setMaxAge(1200);
                response.addCookie(cookie1);
                request.getRequestDispatcher("welcome.jsp").forward(request,response);
                break;
            }
        }
        Cookie cookie = new Cookie("logined",name);
        cookie.setMaxAge(1200);
        response.addCookie(cookie);
        request.getRequestDispatcher("welcome.jsp").forward(request,response);
%>
</body>
</html>
